//
//  HWHomePageViewController.m
//  HWPromoteProjectAPP
//
//  Created by 陈道斌 on 2020/1/20.
//  Copyright © 2020 陈道斌. All rights reserved.
//

#import "HWHomePageViewController.h"
#import "HWliushuiCollectionViewCell.h"
#import "HWLoginViewController.h" // 登录界面
#import "HWPromotionQrCodeViewController.h" // 推广二维码
#import "HWPromoteGameViewController.h"
#import "HWApplyGameViewController.h"  // 申请游戏

#import "HWDiscountDaiChunViewController.h" //  折扣代充

#import "HWApplyjiesuanViewController.h" // 申请结算

#import "MyOfflineViewController.h"  // 我的下线

#import "HWDividedIntoViewController.h" // 分成提现

#import "JXCircleModel.h"
#import "JXCircleRatioView.h"
#import "HWBillingDetailsViewController.h"


#define PIE_HEIGHT  260
#define Radius 90.5 //圆形比例图的半径"





@interface HWHomePageViewController ()<UITableViewDataSource,UITableViewDelegate,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout,UICollectionViewDataSource>
@property(strong,nonatomic) UITableView *mainTabelView;
@property(strong,nonatomic) UIView *hederView;

@property(strong,nonatomic) UIView *navigationTopView;
@property(strong,nonatomic) UILabel *zhanghaoLabel;
@property(strong,nonatomic) UILabel *qudaoLabel; //渠道ID
@property(strong,nonatomic) UIImageView *icoIamgeView; // 头像

// 流水记录
@property(strong,nonatomic)UIView *runningWaterView;
@property(strong,nonatomic) UICollectionView *maincollectionView;


// 数据统计
@property(strong,nonatomic)UIView *shujuView;
@property(nonatomic, strong) JXCircleRatioView *circleView_one;
@property(nonatomic, strong) NSMutableArray *data1;


// 常用功能
@property(strong,nonatomic)UIView *commonlyUsedView;
@property(strong,nonatomic) NSMutableArray * redhongseViewMuArr;
@property(strong,nonatomic) NSMutableArray  *imageMuArr;
@property(strong,nonatomic) NSMutableArray *labelMuArr;


@property(strong,nonatomic)NSDictionary *dataDic;
@property(strong,nonatomic)NSMutableArray  *liushuMuArr; //流水记录
@property(strong,nonatomic)NSMutableArray  *commonlyUsedMuArr; //常用功能
@property(strong,nonatomic)NSDictionary   *statisticsDic;








@end

@implementation HWHomePageViewController


- (NSMutableArray *)data1{
    if (_data1 == nil) {
        _data1 = [NSMutableArray array];
        
        NSArray *colors = @[RGB(85, 89, 234),RGB(66, 206, 158)];
        
        NSString    *numberStr =  self.statisticsDic[@"data"][@"number"];
        int  number  =  [numberStr intValue];
        
        NSString *totalPeopleStr = self.statisticsDic[@"totalPeople"];
        int  totalPeople = [totalPeopleStr  intValue];
        
        int  qita = totalPeople - number;
        NSString *qitaStr = [NSString stringWithFormat:@"%d",qita];
        
        NSString *titleStr = self.statisticsDic[@"data"][@"title"];
        
        
        NSString   *percentStr =  self.statisticsDic[@"data"][@"percent"];
        
        double  percent  = [percentStr doubleValue];
        
        double  qitabile1 =  100 - percent;
        
        NSString *percent1 = [NSString stringWithFormat:@"%.2f%%",percent];
        
        NSString *qitabilei = [NSString stringWithFormat:@"%.2f%%",qitabile1];
        
        
        
        NSArray *numbers = @[numberStr,qitaStr];
        NSArray *names = @[titleStr,@"其它"];
        NSArray *columns = @[percent1,qitabilei];
        
        for (int i = 0; i < numbers.count; i++) {
            JXCircleModel *model = [[JXCircleModel alloc]init];
            model.color = colors[i];
            model.number = numbers[i];
            model.name = names[i];
            model.column = columns[i];
            
            
            
            [_data1  addObject:model];
        }
        
    }
    return _data1;
}


//- (JXCircleRatioView *)circleView_one{
//    if (!_circleView_one) {
//
//        _circleView_one = [[JXCircleRatioView alloc]initWithFrame:CGRectMake(0, 50, self.view.bounds.size.width, PIE_HEIGHT)  andDataArray:self.data1 CircleRadius:Radius];
//        _circleView_one.backgroundColor = [UIColor whiteColor];
//    }
//    return _circleView_one;
//}

- (JXCircleRatioView *)circleView_one{
    if (!_circleView_one) {
        
        _circleView_one = [[JXCircleRatioView alloc]initWithFrame:CGRectMake(0, 40, self.view.bounds.size.width, PIE_HEIGHT)  andDataArray:self.data1 CircleRadius:Radius];
        _circleView_one.backgroundColor = [UIColor whiteColor];
        //  _circleView_one.backgroundColor = [UIColor redColor];
    }
    return _circleView_one;
}



- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    [self.navigationController setNavigationBarHidden:YES ];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO];
    
}



- (UITableView *)mainTabelView {
    
    if (_mainTabelView == nil) {
        _mainTabelView = [[UITableView alloc]initWithFrame:CGRectMake(0, NavBarHeight+20, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight-20) style:UITableViewStylePlain];
        _mainTabelView.delegate = self;
        _mainTabelView.dataSource = self;
        _mainTabelView.backgroundColor =beijingyanSe;
        
        
    }
    return _mainTabelView;
    
    
}



- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    //  self.view.backgroundColor = [UIColor redColor];
    [self setCommonProperties];
    //设置UI
    [self setupUI];
    
    // 添加导航
    [self addNaVigationView];
    
    [self setupNavigateshuju];
    
    
    
    
    
    
    
}




// 设置导航数据
- (void)setupNavigateshuju {
    
    self.zhanghaoLabel.text = [NSString stringWithFormat:@"%@",[HWLocallyStoredData getUsername]];
    self.qudaoLabel.text = [NSString stringWithFormat:@"%@",@"用户名"];
    [self.icoIamgeView  sd_setImageWithURL:[NSURL URLWithString:[HWLocallyStoredData getHead]] placeholderImage:nil];
    
    
    
}


- (void)setCommonProperties  {
    
    self.view.backgroundColor = beijingyanSe;
    
}


// 添加导航
-(void)addNaVigationView  {
    // 这个是 66
    self.navigationTopView  = [[UIView alloc]initWithFrame:CGRectMake(0, 0 , SCREEN_WIDTH, 44+StatusBarHeight+20)];
    self.navigationTopView .backgroundColor = [UIColor whiteColor];
    [self.view addSubview:  self.navigationTopView ];
    
    self.zhanghaoLabel  = [[UILabel alloc]initWithFrame:CGRectMake(20, StatusBarHeight+15, 300, 25)];
    self.zhanghaoLabel.text = @"63527373";
    self.zhanghaoLabel.textAlignment =  NSTextAlignmentLeft;
    self.zhanghaoLabel.textColor = RGB(68, 68, 68);
    self.zhanghaoLabel.font = [UIFont systemFontOfSize:18];
    [self.navigationTopView  addSubview:self.zhanghaoLabel];
    
    
    self.qudaoLabel  = [[UILabel alloc]initWithFrame:CGRectMake(20, self.zhanghaoLabel.bottom, 300, 12)];
    self.qudaoLabel.text = @"63527373";
    self.qudaoLabel.textAlignment =  NSTextAlignmentLeft;
    self.qudaoLabel.textColor = RGB(193, 193, 203);
    self.qudaoLabel.font = [UIFont systemFontOfSize:10];
    [self.navigationTopView  addSubview:self.qudaoLabel];
    
    
    self.icoIamgeView = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 36-20, StatusBarHeight+15, 36, 36)];
    self.icoIamgeView.backgroundColor = [UIColor redColor];
    self.icoIamgeView.layer.cornerRadius = 12;
    self.icoIamgeView.layer.masksToBounds  = YES;
    [self.navigationTopView  addSubview:self.icoIamgeView];
    
    
    
    
}





//设置UI
- (void)setupUI {
    
    [self.view addSubview:self.mainTabelView];
    self.hederView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 114+300+210)];
    self.hederView.backgroundColor = beijingyanSe;
    self.mainTabelView.tableHeaderView = self.hederView;
    self.mainTabelView.tableFooterView = [[UIView alloc]init];
    
    //添加headerView
    [self addheadeView];
    
    //发送网络请求
    [self sendNetworkRequest];
    
    
    
    
    
    
    
    
}




// 发送网络请求
- (void)sendNetworkRequest {
    
    
    
    
    NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    NSString *uid =  [HWLocallyStoredData getLoginUserID];
    NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uid,tStr,@"adesxloksy13s98adv"];
    NSString  *signStrMd5  =   [WMUtil md5HexDigest:signStr];
    
    
    
    
    NSDictionary *parametes = @{      @"ios" : @"1",
                                      @"ct" : @"app",
                                      @"ac" : @"index",
                                      @"t" : tStr,
                                      @"uid":uid,
                                      @"sign" :signStrMd5
    };
    
    
    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
        
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        if ([codeStr intValue] == 1) {
            
            NSLog(@"%@",response);
            self.dataDic = response[@"data"];
            self.liushuMuArr = [(NSArray *)self.dataDic[@"recharge"]  mutableCopy];
            
            
            self.commonlyUsedMuArr = [(NSArray *)self.dataDic[@"function"]  mutableCopy];
            
            self.statisticsDic = (NSDictionary *)self.dataDic[@"statistics"];
            
            
            if([[HWLocallyStoredData getAppStr] isEqualToString:@"3"]) {
                
                self.commonlyUsedView.hidden = YES;
                
                
                
            } else {
                
                self.commonlyUsedView.hidden = NO;
                
            }
            
            
            
            //   self.commonlyUsedView
            
            [self requestedDataIsDisplayedToTheView];
            
            //                      self.dataDic = response[@"data"];
            //                      self.zeongjingerLabel.text = [NSString stringWithFormat:@"%@",self.dataDic[@"money"]];
            //                      self.fengxiangyongjingLabel.text = [NSString stringWithFormat:@"%@",self.dataDic[@"shareMoney"]];
            //                      self.yitixianjingLabel.text = [NSString stringWithFormat:@"%@",self.dataDic[@"withdraw"]];
            
            
            [self.mainTabelView reloadData];
            
            
            
            
            
            
            
            
        } else {
            
            [MBProgressHUD showError:response[@"message"]];
            
            
            
        }
        
        
        
    } failure:^(NSString *error) {
        // [SVProgressHUD dismiss];
        
        [MBProgressHUD showSuccess:@"登录失败"];
        [MBProgressHUD hideHUD];
        
        
        
        
    }];
    
    
}


//网络请求的数据展示到页面上
- (void)requestedDataIsDisplayedToTheView {
    
    
    [self.maincollectionView reloadData];
    // imageMuArr
    
    for (int i = 0; i <  self.commonlyUsedMuArr.count; i++) {
        
        UIView  *view =    self.redhongseViewMuArr[i];
        view.hidden = NO;
        
        UIImageView *iamgeView = self.imageMuArr[i];
        UILabel   *labe  =   self.labelMuArr[i];
        NSDictionary *dic =  self.commonlyUsedMuArr[i];
        NSString *iamgeIco = dic[@"image"];
        [iamgeView sd_setImageWithURL:[NSURL URLWithString:iamgeIco] placeholderImage:nil];
        labe.text = [NSString stringWithFormat:@"%@",dic[@"title"]];
        
        labe.hidden = NO;
        iamgeView.hidden = NO;
        
        
        
    }
    
    [self.shujuView addSubview:self.circleView_one];
    
    
    //    self.circleView_one.hidden = YES;
    
    
    NSString *totalPeoplestr = [NSString stringWithFormat:@"%@",self.statisticsDic[@"totalPeople"]];
    
    
    if ([totalPeoplestr isEqualToString:@"0"]) {
        self.circleView_one.hidden = YES;
        
        
        
    }
    
    
    
    
    UILabel *zongrenLabel = [[UILabel alloc]initWithFrame:CGRectMake((self.view.bounds.size.width-120)/2, (PIE_HEIGHT-120)/2+40, 120, 120)];
    zongrenLabel.layer.cornerRadius = 60;
    zongrenLabel.layer.masksToBounds = YES;
    zongrenLabel.text = [NSString stringWithFormat:@"总人数\n%@",self.statisticsDic[@"totalPeople"]];
    
    
    zongrenLabel.font = [UIFont systemFontOfSize:16];
    zongrenLabel.textColor = [UIColor whiteColor];
    zongrenLabel.numberOfLines = 2 ;
    zongrenLabel.textAlignment = NSTextAlignmentCenter;
    
    zongrenLabel.backgroundColor = RGB(255, 182, 10);
    [self.shujuView addSubview:zongrenLabel];
    
    
    
    
}









//添加headVIew
-(void)addheadeView  {
    
    
    
    self.runningWaterView  = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 114)];
    self.runningWaterView.backgroundColor = beijingyanSe;
    [self.hederView  addSubview:  self.runningWaterView];
    
    
    
    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
    layout.scrollDirection =  UICollectionViewScrollDirectionHorizontal;
    layout.minimumLineSpacing = 10;
    
    //    CGFloat juanju  = (kScreenW - 24*CFLScaleValue*2-62*CFLScaleValue*3-78*CFLScaleValue)/2;
    layout.minimumInteritemSpacing = 10;
    //    layout.headerReferenceSize = CGSizeMake(kScreenW, 142);  //设置headerView大小
    self.maincollectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(20, 20, kScreenW-20, 114-40) collectionViewLayout:layout];
    // self.maincollectionView.showsHorizontalScrollIndicator = NO;
    self.maincollectionView.delegate = self;
    self.maincollectionView.dataSource = self;
    self.maincollectionView.alwaysBounceHorizontal = YES;
    self.maincollectionView.backgroundColor = [UIColor whiteColor];
    self.maincollectionView.backgroundColor = RGB(244, 243, 244);
    
    
    // self.maincollectionView.contentInset = UIEdgeInsetsMake(0, 15, 0, 15);
    //self.maincollectionView.contentInset = UIEdgeInsetsMake(0, 24*CFLScaleValue, 0, 24*CFLScaleValue);
    //[self.maincollectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HeaderView"];  //  一定要设置
    [self.maincollectionView registerClass:[HWliushuiCollectionViewCell class] forCellWithReuseIdentifier:@"cellID"];
    //[self.maincollectionView  registerNib:[UINib nibWithNibName:@"HWJinXuanCell" bundle:nil] forCellWithReuseIdentifier:@"cellID"];
    self.maincollectionView.userInteractionEnabled = YES;
    [self.runningWaterView  addSubview:self.maincollectionView];
    
    // 数据统计
    [self shujutongjiView];
    // 添加常用的UIView
    [self addcommonlyUsedView];
    
    
    
    
    
    
}



// 数据统计UIview

- (void)shujutongjiView {
    
    
    self.shujuView  = [[UIView alloc]initWithFrame:CGRectMake(0, self.runningWaterView.bottom, SCREEN_WIDTH, 300)];
    self.shujuView.backgroundColor =  [UIColor whiteColor];
    [self.hederView  addSubview: self.shujuView];
    
    
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(20, 24-3, 14, 18)];
    imageView.image = [UIImage imageNamed:@"shugangico"];
    [self.shujuView addSubview:imageView];
    
    UILabel  *changyongLabel   = [[UILabel alloc]initWithFrame:CGRectMake(imageView.right+6, 20-3, 200, 25)];
    changyongLabel.text = @"数据统计";
    changyongLabel.textAlignment =  NSTextAlignmentLeft;
    changyongLabel.textColor = RGB(68, 68, 68);
    changyongLabel.font = [UIFont systemFontOfSize:18];
    [self.shujuView  addSubview:changyongLabel];
    
    
    
}


// 常用功能UIview
- (void)addcommonlyUsedView {
    
    //  self.commonlyUsedView =
    self.commonlyUsedView   = [[UIView alloc]initWithFrame:CGRectMake(0, self.shujuView.bottom+10, SCREEN_WIDTH, 200)];
    self.commonlyUsedView.backgroundColor =  [UIColor whiteColor];
    [self.hederView  addSubview: self.commonlyUsedView];
    
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(20, 24, 14, 18)];
    imageView.image = [UIImage imageNamed:@"shugangico"];
    [self.commonlyUsedView addSubview:imageView];
    
    UILabel  *changyongLabel   = [[UILabel alloc]initWithFrame:CGRectMake(imageView.right+6, 20, 200, 25)];
    changyongLabel.text = @"常用功能";
    changyongLabel.textAlignment =  NSTextAlignmentLeft;
    changyongLabel.textColor = RGB(68, 68, 68);
    changyongLabel.font = [UIFont systemFontOfSize:18];
    [self.commonlyUsedView  addSubview:changyongLabel];
    
    
    
    NSArray *fanlilistArr = @[@"推广盒子",@"推广游戏",@"申请游戏",@"折扣代充",@"分成结算",@"分成明细",@"我要提现",@"提现明细"];
    NSArray   *paihangbangcoArr = @[@"hezi_ico",@"tuiguan_ico",@"shengqingyouxi",@"zhekou",@"fencheng_ico",@"mingxi_ico",@"tixian_ico",@"tixianmingxi_ico"];
    
    CGFloat hengjianjuLiin = (kScreenW-  55*4)/5;
    self.imageMuArr = [[NSMutableArray alloc]init];
    self.labelMuArr = [[NSMutableArray alloc]init];
    self.redhongseViewMuArr = [[NSMutableArray alloc]init];
    
    for (int i = 0 ; i < fanlilistArr.count; i++) {
        
        int row = i/4;
        int line = i%4;
//        int shulian = (line*2+2) -1;
        
        UIView *redview = [[UIView alloc]initWithFrame:CGRectMake(hengjianjuLiin+hengjianjuLiin*line+line*55, 65+row*30+row*47, 55,47 )];
        redview.tag = i;
        redview.backgroundColor = [UIColor whiteColor];
        redview.hidden = YES;
        [self.commonlyUsedView  addSubview:redview];
        [self.redhongseViewMuArr  addObject:redview];
        
        
        UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imviewTaKaifu:)];
        [redview addGestureRecognizer:tap1];
        
        
        UIImageView *imview = [[UIImageView alloc]initWithFrame:CGRectMake(15, 0,  24, 24)];
        imview.image = [UIImage imageNamed:paihangbangcoArr[i]];
        imview.userInteractionEnabled = YES;
        imview.tag = i;
        imview.hidden = YES;
        [redview addSubview:imview];
        [self.imageMuArr addObject:imview];
        
        
        
        // UILabel
        UILabel *nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 30, 55, 17)];
        nameLabel.text = fanlilistArr[i];
        nameLabel.textAlignment = NSTextAlignmentCenter;
        nameLabel.font = [UIFont systemFontOfSize:12];
        nameLabel.textColor = RGB(68, 68, 68);
        nameLabel.hidden = YES;
        [redview addSubview:nameLabel];
        [self.labelMuArr addObject:nameLabel];
        
        
        
        
        
        
        
    }
    
    
    
    
}










- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    
    
    return  0;
    
    
    
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *cellID = @"cellID";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    
    return  cell;
    
    
    
    
    
}




#pragma  mark ---------  UICollectionViewDelegate



- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    
    
    return self.liushuMuArr.count;
}




- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    
    HWliushuiCollectionViewCell *cell =  [collectionView dequeueReusableCellWithReuseIdentifier:@"cellID" forIndexPath:indexPath];
    //   cell.backgroundColor =[UIColor yellowColor];
    //   HWGameListModel *mode = self.dataMuArr[indexPath.row+2];
    //   cell.model = mode;
    cell.layer.cornerRadius = 12;
    cell.layer.masksToBounds = YES;
    
    
    if (indexPath.row == 0) {
        
        cell.backgroundColor = RGB(85, 89, 234);
        
    } else {
        
        cell.backgroundColor = RGB(66, 206, 158);
        
    }
    
    NSDictionary *dic = self.liushuMuArr[indexPath.row];
    cell.jingELabel.text = [NSString stringWithFormat:@"%@",dic[@"money"]];
    cell.liushui.text = [NSString stringWithFormat:@"%@",dic[@"title"]];
    
    return cell;
    
    
}


- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    
    if (indexPath.row == 0 ) {
        CGSizeMake(108,114-40);
    }
    return CGSizeMake(124,114-40);
    
    
}











#pragma  mark -------------- 添加点击图片事件

- (void)imviewTaKaifu:(UITapGestureRecognizer *) sender {
    
    UIView *view =  sender.view;
    NSInteger tagshuju =  view.tag;
    
    NSDictionary *dic =  self.commonlyUsedMuArr[tagshuju];
    NSString *typeStr = dic[@"type"];
    int    type =  [typeStr intValue];
    if (type == 0) {
        
        
        HWPromotionQrCodeViewController *promol = [[HWPromotionQrCodeViewController alloc]init];
        [self.navigationController pushViewController:promol animated:YES];
        
        
        
        
    } else if (type == 1) {
        
        HWPromoteGameViewController *promo = [[HWPromoteGameViewController alloc]init];
        [self.navigationController pushViewController:promo animated:YES];
        
        
        
        
    } else if (type == 2) {
        
        
        HWApplyGameViewController *ApplyGame = [[HWApplyGameViewController alloc]init];
        [self.navigationController pushViewController:ApplyGame animated:YES];
        
        
    }else if (type == 3) {
        
        
        HWDiscountDaiChunViewController *dicci = [[HWDiscountDaiChunViewController alloc]init];
        [self.navigationController pushViewController:dicci animated:YES];
        
        
        
        
        
    }else if (type == 4) {
        
        
        HWApplyjiesuanViewController *Applyjiesuan = [[HWApplyjiesuanViewController  alloc]init];
        [self.navigationController pushViewController:Applyjiesuan animated:YES];
        
        
        
    }else if (type == 5) {
        
        HWBillingDetailsViewController *bill = [[HWBillingDetailsViewController alloc]init];
        [self.navigationController pushViewController:bill animated:YES];
        
        
        
    }else if (type == 10) {
        
        
        MyOfflineViewController *myoff = [[MyOfflineViewController alloc]init];
        [self.navigationController pushViewController:myoff animated:YES];
        
        
    }else if (type == 7) {
        
        
        HWDividedIntoViewController *DividedInto = [[HWDividedIntoViewController alloc]init];
        [self.navigationController pushViewController:DividedInto animated:YES];
        
        
    }else if (type == 8) {
        
        
        
        
        
    }
    
    
    
    
    
    
    
    
    
    
    
    NSLog(@"ywyeywyy");
    
    
    
}


@end
